<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .item{
            text-decoration: none;
            font-size: 30px;
            background-color: red;

        }
        .one{
            color: blueviolet;
        }
        .two{
            color: aqua;
        }
    </style>
</head>
<body>
    <!-- <div class="box">
        <img src="../FZ传输文件/001.jpg" alt="">

    </div>
    <div class="box"> -->

    </div>
    <script>
        let box = document.querySelector(".box")

        // let a = document.createElement("a")
        //href属性
        // a.href = "https://www.baidu.com/"
        // a.setAttribute("属性名","属性值")   给哪个节点添加属性 就是谁调用
        // a.setAttribute("class","item")
        // a.getAttribute("属性名")   返回值 是该属性名上的 属性值
        // a.removeAttribute("属性名")   删除对应属性
        // a.innerText = "百度一下"
        // box.appendChild(a)

        // let img = document.querySelector("img")
        // let b = img.getAttribute("src")
        // console.log(b);
        
        // img.removeAttribute("src")

        let div = document.createElement("div")
        box.appendChild(div)
        div.setAttribute("class","item")
        let p1 = document.createElement("p") 
        let p2 = document.createElement("p") 
        div.appendChild(p1)
        div.appendChild(p2)
        p1.setAttribute("class","one")
        p1.innerText = "11111"
        p2.setAttribute("class","two")
        p2.innerText = "22222"







    </script>
</body>
</html>